package com.gd.server.action;



import java.util.UUID;

import com.gd.common.entities.S_User;
import com.gd.common.net.RequestToServer;
import com.gd.common.net.Response;
import com.gd.server.dao.UserDao;
import com.gd.server.service.DaoFactory;
import com.gd.server.service.ServerContext;



public class ModifyAction extends ServerAction{

	@Override
	public void executeSome(RequestToServer request, Response response)
			throws Exception {
		
		UUID sessionId = (UUID) request.getParameter("SessionId");
		String nickName = (String) request.getParameter("NickName");
		String password = (String) request.getParameter("Password");
		long birthday = (Long) request.getParameter("Birthday");
		int userId = ServerContext.onlineUsers.get(sessionId).getUser_id();
		UserDao userDao = DaoFactory.getUserDao();
		
		userDao.updateUser(userId,nickName, password, birthday);
	}
}
